<template>
  <div>
    <div class="component-mainHeader">
      <div class="top">
        <div class="topleft">
          <p>
            <span class="iconfont" style="color:#1abc9a;margin-right:3px;">&#xe607;</span>管线信息
          </p>
        </div>
        <div class="topright">
          <el-button type="info" @click="$router.go(-1)">
            <span style="font-weight:700;margin-right:5px;" class="iconfont">&#xe606;</span>返回
          </el-button>
        </div>
      </div>
    </div>
    <div class="main">
      <div class="nav">管线信息</div>
      <div class="step-container"></div>

      <el-tabs v-model="activeName" type="border-card" @tab-click="handleClick" class="tabs">
        <el-tab-pane label="新建工程" name="first">
          <div class="tables">
            <table cellpadding="0" cellspacing="0" border="1">
              <tr>
                <td>工程名称</td>
                <td>{{tableOne.proName}}</td>
                <td>所属城市</td>
                <td>{{tableOne.proCity}}</td>
              </tr>
              <tr>
                <td>工程状态</td>
                <td>{{tableOne.proStatus}}</td>
                <td>监理单位</td>
                <td>{{tableOne.monitorOrgName}}</td>
              </tr>
              <tr>
                <td>设计单位</td>
                <td>{{tableOne.designOrgName}}</td>
                <td>施工单位</td>
                <td>{{tableOne.workOrg}}</td>
              </tr>
            </table>
          </div>
          <div style="width:1050px;margin: 30px auto;text-align:left;">
            <p>参考模板：</p>
            <img src="../../../../static/moveSystemRefTamplate/referenceTemplate4.png" style="max-width:1000px;">
          </div>
        </el-tab-pane>
        <el-tab-pane label="新建光交" name="second">
          <div class="tables">
            <table cellpadding="0" cellspacing="0" border="1">
              <tr>
                <td>所属区县</td>
                <td>{{tableTwo.country}}</td>
              </tr>
              <tr>
                <td>维护方式</td>
                <td>{{tableTwo.defendType}}</td>
              </tr>
              <tr>
                <td>所属模板</td>
                <td>{{tableTwo.template}}</td>
              </tr>
              <tr>
                <td>所属工程</td>
                <td>{{tableTwo.proName}}</td>
              </tr>
              <tr>
                <td>一线数据维护人</td>
                <td>{{tableTwo.dataMaintainer}}</td>
              </tr>
            </table>
          </div>

          <div class="table" style="margin-top: 25px;">
            <el-table
              ref="multipleTable"
              :data="tableTwo.gjMsgList"
              tooltip-effect="dark"
              style="width: 1100px;margin:0 auto"
              border
            >
              <el-table-column label="编号" align="center" width="100" prop="number"></el-table-column>
              <el-table-column label="光交箱名称" align="center" width="150" prop="gjname"></el-table-column>
              <el-table-column label="设备编码" align="center" width="150" prop="gjno"></el-table-column>
              <el-table-column label="经度" align="center" width="100" prop="lat"></el-table-column>
              <el-table-column label="纬度" align="center" width="100" prop="lng"></el-table-column>
              <el-table-column label="详细地址" align="center" prop="address"></el-table-column>
            </el-table>
          </div>
          <div style="width:1050px;margin: 30px auto;text-align:left;">
            <p>参考模板：</p>
            <img src="../../../../static/moveSystemRefTamplate/referenceTemplate5.png" style="max-width:1000px;">
          </div>
        </el-tab-pane>
      </el-tabs>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      baseUrl: img_url,
      activeName: "first",
      // 选项卡1 数据
      tableOne: {},
      // 选项卡2 数据
      tableTwo: {},
      tableData:[]
    };
  },
  created() {},
  mounted() {
    this.oneDataInit();
  },
  methods: {
    //tab切换
    handleClick(tab, event) {
      switch (this.activeName) {
        case "first":
          this.oneDataInit();
          break;
        case "second":
          this.twoDataInit();
          break;
      }
    },

    // 表一
    oneDataInit() {
      let that = this,
        suCb = res => {
          console.log("表一：", res);
          that.tableOne = that.deepClone(res.data.data);
        },
        erCb = res => {
          console.log(res);
        },
        req = {
          url: "/api/web/cmccClerk/queryNewProject",
          methods: "post",
          data: { proId: that.$route.query.proId },
          success: suCb,
          error: erCb
        };
      that.$https(req);
    },
    // 表二
    twoDataInit() {
      let that = this,
        suCb = res => {
          console.log("表二：", res);
          that.tableTwo = that.deepClone(res.data.data);
        },
        erCb = res => {
          console.log(res);
        },
        req = {
          url: "/api/web/cmccClerk/queryNewGj",
          methods: "post",
          data: { proId: that.$route.query.proId },
          success: suCb,
          error: erCb
        };
      that.$https(req);
    }
  },
  watch: {}
};
</script>
<style scoped>
.main {
  width: 1100px;
  margin: 20px auto;
  box-sizing: border-box;
  border: 1px solid #e4e4e4;
  font-size: 14px;
}
.main .nav {
  height: 40px;
  line-height: 40px;
  padding-left: 20px;
  text-align: left;
  background: #f3f3f3;
  color: #666;
  border-bottom: 1px solid #e4e4e4;
  margin-bottom: 30px;
}
.step-container {
  margin-bottom: 60px;
}
.gcl {
  margin-bottom: 20px;
}
.tabs {
  width: 1060px;
  margin: 20px auto;
}
.budget {
  margin-top: 20px;
  width: 100%;
  overflow: hidden;
  background: #f8f8f8;
  height: 35px;
  line-height: 35px;
  font-size: 14px;
  border: 1px solid #e4e4e4;
  border-bottom: none;
  padding: 0 20px;
  box-sizing: border-box;
  font-size: 14px;
  color: #666;
}
.gcl .title {
  background: #f8f8f8;
  height: 35px;
  line-height: 35px;
  color: #666;
  padding: 0 20px;
  font-size: 14px;
  border: 1px solid #e4e4e4;
  border-bottom: none;
  text-align: left;
}
.budget .title {
  float: left;
}
.budget div:last-of-type {
  float: right;
}
.gcl .tabs {
  width: 1060px;
  margin: 20px;
  box-sizing: border-box;
}
.nav {
  background: #f8f8f8;
  height: 50px;
  font-size: 14px;
  line-height: 50px;
  border-bottom: 1px solid #e4e4e4;
  text-align: left;
  padding-left: 20px;
  font-size: 14px;
  color: #666;
}
.tables table {
  width: 660px;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
}
.budgetTable table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
}
.budgetTable table td {
  /* width: 500px; */
  height: 40px;
}
.tables table td {
  height: 44px;
}
.tables table td:nth-of-type(2n) {
  text-align: left;
  padding-left: 20px;
}
.tables table td:nth-of-type(2n + 1) {
  text-align: right;
  padding-right: 20px;
  width: 85px;
  background: #f9fafc;
}
.costManage {
  overflow: hidden;
  font-size: 14px;
}
.costManage .left,
.costManage .right {
  float: left;
}
.costManage .left {
  margin-right: 60px;
}
.costManage .cost {
  text-align: left;
  color: #949494;
  margin-bottom: 10px;
}
.costManage .left span,
.costManage .right span {
  display: inline-block;
  width: 100px;
  text-align: right;
  padding-right: 10px;
  height: 30px;
  color: #666;
  font-size: 12px;
}
.costManage .left span i,
.costManage .right span i {
  color: red;
  vertical-align: middle;
  font-style: normal;
  padding-right: 2px;
}
.costManage .left input,
.costManage .right input {
  height: 30px;
  padding-left: 5px;
  outline: none;
  border: 1px solid #e4e4e4;
  border-radius: 2px;
}

/* 下面是进度管理的样式 */
.step-container {
  margin: 20px auto;
}
.table-title p {
  font-family: "PingFangSC-Regular", "PingFang SC";
  font-weight: 400;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
  font-kerning: normal;
  font-size: 16px;
  color: #666;
  text-align: left;
  line-height: 40px;
}

.tables table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
}
.tables table td {
  height: 44px;
}
.tables table td:nth-of-type(2n) {
  text-align: left;
  padding-left: 20px;
  width: 332px;
}
.pipe-progress .tables table td:nth-of-type(2n),
.line-progress .tables table td:nth-of-type(2n),
.equipment-progress .tables table td:nth-of-type(2n) {
  width: 332px;
}
.tables table td:nth-of-type(2n + 1) {
  text-align: right;
  padding-right: 20px;
  width: 85;
  background: #f9fafc;
}

.component-paging .table-bottom,
.component-paging .table-bottom,
.component-paging .table-bottom {
  width: 100%;
  margin-bottom: 20px;
}

.pipe-progress .table,
.line-progress .table,
.equipment-progress .table {
  margin-top: 20px;
}

/* 材料管理 */
.material-manage .search-header {
  width: 100%;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 1);
  margin: 20px auto 0;
}

.material-manage .search-header .left-title {
  display: flex;
  justify-content: space-between;
  width: 100%;
  background-color: rgba(243, 243, 243, 1);
  height: 45px;
  box-sizing: border-box;
  border: 1px solid rgba(228, 228, 228, 1);
  border-bottom: 0;
}

.material-manage .search-header .left-title .left-text {
  width: 20%;
  color: #666;
  font-size: 14px;
  line-height: 45px;
  font-weight: 700;
  text-align: left;
  margin: 0 0 0 30px;
}

.material-manage .right {
  width: 70%;
  display: flex;
  justify-content: flex-end;
  margin-right: 30px;
}

.material-manage .right button {
  padding: 0 15px;
  height: 30px;
  margin: 6px 5px;
  line-height: 30px;
  font-size: 14px;
  color: #666;
  background-color: #fff;
  border: 1px solid #ccc;
}

.material-manage .right button:hover {
  background-color: #f3f3f3;
}

/* 资料归档 */
.data-back-sign,
.owner-data,
.design-check-data,
.process-manage-data,
.project-finish-data,
.official-data,
.move-system-data {
  margin: 20px auto;
}
.table-title-left {
  color: #1abc9c;
  font-size: 16px;
  float: right;
}

.gray {
  color: #ccc;
}

/* 删除按钮 */
.red {
  color: #48c9b0;
  font-size: 12px;
}

.data-back-sign .tables table td:nth-of-type(2n + 1) {
  text-align: right;
  padding-right: 20px;
  width: 110px;
  background: #f9fafc;
}

.move-system-msg .tables table td:nth-of-type(2n + 1) {
  text-align: right;
  padding-right: 20px;
  width: 140px;
  background: #f9fafc;
}

.table-title > div:last-of-type {
  float: right;
  margin: -45px 20px 10px;
}
.table-title > div:last-of-type span {
  display: inline-block;
  margin-left: 20px;
  padding: 5px 20px;
  margin-top: 10px;
  cursor: pointer;
  border-radius: 4px;
}
.table-title > div:last-of-type span:first-of-type {
  border: 1px solid #e4e4e4;
  color: #666;
  background: #fff;
}
.table-title > div:last-of-type span:last-of-type {
  border: 1px solid #1abc9c;
  color: #fff;
  background: #1abc9c;
}

/* 工程量管理 按钮组 */
.btn_group {
  text-align: left;
  margin-bottom: 15px;
}

/* 工程量管理 底部 价格显示 */
.gcl_footer {
  text-align: right;
}

.gcl_footer .gcl_footer_top {
  margin-bottom: 10px;
  font-size: 18px;
}

.gcl_footer .gcl_footer_top span:nth-child(2n),
.gcl_footer .gcl_footer_bottom span:nth-child(2n) {
  color: #1abc9c;
}

.gcl_footer .gcl_footer_bottom {
  margin-bottom: 10px;
  font-size: 19px;
}

.budgetTable table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 0;
  padding: 0;
  border: none;
  font-size: 12px;
}
.budgetTable table td,
th {
  height: 40px;
}

th {
  background-color: #f9fafc;
}

/* 建项审批列表最外层容器 pro-amap Start*/
.pro-amap {
  widows: 100%;
}
/* 建项审批列表最外层容器 pro-amap End and 地图容器 Start */
.amap {
  width: 100%;
  height: 500px;
  position: relative;
}
#container {
  position: absolute;
  width: 100%;
  height: 100%;
}
/* 地图容器 End and 数据展示列表 Start */
.table {
  width: 100%;
  /* margin-top: 20px; */
}
.table-title {
  text-align: left;
  color: #949494;
  font-size: 16px;
}
.amap-all-table-header {
  display: flex;
  align-items: center;
  margin: 10px 0 20px;
}
.amap-all-table-btn {
  width: 120px;
  height: 30px;
  line-height: 30px;
  cursor: pointer;
  border: 1px solid #e4e4e4;
}
.amap-all-table-btn:not(:first-child) {
  margin-left: 20px;
}
.amap-all-table-btn-active {
  background: #1abc9c;
  color: #fff;
}
.amap-all-table-header-update {
  margin-left: 300px;
}
/* 数据展示列表 End */
</style>

<!-- 在全局中修改地图的css -->
<style>
.pro-amap .marker-container {
  position: relative;
}
.pro-amap .marker-container img {
  position: absolute;
}
.pro-amap .marker-container div:nth-child(2) {
  color: red;
  position: absolute;
  top: -20px;
  left: 0;
}
.pro-amap .marker-container div:nth-child(3) {
  height: 20px;
  line-height: 20px;
  padding: 3px 6px;
  background: #fff;
  border: 1px solid red;
  position: absolute;
  left: 6px;
  top: 6px;
}
</style>
